Skip to content

feat(planners): port BasePlanner, BuiltInPlanner and PlanReActPlanner - #941

Merged
ScottMansfield merged 1 commit into
mainfrom
foundry/c1351db8-b98b-4369-907a-0b6fee584dc8
Sep 24, 2026
Merged

ScottMansfield merged 1 commit into
mainfrom
foundry/c1351db8-b98b-4369-907a-0b6fee584dc8

Conversation

@ScottMansfield

Copy link
Copy Markdown
Member

Task

Port the planners package of adk-python v0.1.0 (src/google/adk/planners: base_planner.py, built_in_planner.py, plan_re_act_planner.py) into adk-js as core/src/planners. This is a new capability. No planner code exists in adk-js today. Wiring a planner into LlmAgent and a planning request/response processor is NOT part of this task (see open_questions).

Produced by Foundry (task c1351db8-b98b-4369-907a-0b6fee584dc8). Reviewed by an automated
reviewer before upload; still needs human review.

@google-cla

google-cla Bot commented Sep 24, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@ScottMansfield
ScottMansfield force-pushed the foundry/c1351db8-b98b-4369-907a-0b6fee584dc8 branch 4 times, most recently from 5dc1121 to 725f8cd Compare September 24, 2026 17:29

@AmaadMartin AmaadMartin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Faithful port of adk-python v0.1.0 planners, verified field by field against the reference (base, built-in, plan-re-act). The three classes reach the public API through common.ts and index.ts; the Python helper methods are extracted to module functions; the code uses native @google/genai types and adds no type suppressions or instanceof checks. The tests pin the instruction text and the response processing, including the deliberate copy-instead-of-mutate change from the Python source. CI: run-tests passed on ubuntu and was still running on macos and windows at review time, and cla/google reported a failure, which is not a code issue in the diff.

@AmaadMartin AmaadMartin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. This is a faithful port of the adk-python v0.1.0 planners, checked field by field against the v0.1.0 source: the base class, the built-in planner, the Plan-Re-Act logic, and the instruction text (pinned character for character, including the should be be under typo). Exports, types, and tests are correct, with no suppressions and no instanceof. One optional note below. CI: run-tests passed on all three platforms; cla/google shows a failure, which is a contributor-agreement gate and not a code issue.

handleNonFunctionCallPart(part, preservedParts);
}

if (firstFcPartIndex > 0) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, optional. This guard matches adk-python v0.1.0, so no change is needed for this port.

Note for awareness: upstream later changed it to >= 0. With > 0, a response that starts with a function call keeps only the first call and drops the following consecutive calls. Confirm you want the v0.1.0 behaviour.

@AmaadMartin AmaadMartin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Faithful port of adk-python v0.1.0 planners, verified field by field against the v0.1.0 reference. The > 0 guard in processPlanningResponse, the be be typo in the instruction text, and the absence of tag-stripping all match v0.1.0; adk-python added the later variants after v0.1.0. The three classes reach the public API through common.ts, use native @google/genai types, and add no any, instanceof, or suppressions. The markAsThought copy-instead-of-mutate change is a safe JS convention, and the tests pin it. CI: all four run-tests jobs passed at the head SHA; cla/google failed, which is a contributor-agreement matter outside the diff.

@AmaadMartin AmaadMartin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Faithful port of the adk-python v0.1.0 planners, verified field by field against the reference at the head SHA (base_planner, built_in_planner, plan_re_act_planner). No type suppressions, no instanceof, and the three classes are exported from common.ts. My earlier note on the > 0 guard (plan_re_act_planner.ts:69) is an optional nit that matches v0.1.0, not a blocker. CI was green at review time.

@AmaadMartin AmaadMartin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-verified at head 725f8cd against adk-python v0.1.0: a faithful, field-by-field port of BasePlanner, BuiltInPlanner and PlanReActPlanner. The three classes are exported through common.ts and reach index.ts by export * from './common.js'. The diff adds no type suppressions, no instanceof, and no console.log. My one open comment is an optional nit: the firstFcPartIndex > 0 guard matches v0.1.0 (line 72), so no change is needed. CI note: run-tests passes on all platforms; cla/google fails, which is a contributor-agreement gate, not a code defect.

## Task
Port the planners package of adk-python v0.1.0 (src/google/adk/planners: base_planner.py, built_in_planner.py, plan_re_act_planner.py) into adk-js as core/src/planners. This is a new capability. No planner code exists in adk-js today. Wiring a planner into LlmAgent and a planning request/response processor is NOT part of this task (see open_questions).

Produced by Foundry (task c1351db8-b98b-4369-907a-0b6fee584dc8). Reviewed by an automated
reviewer before upload; still needs human review.
@ScottMansfield
ScottMansfield force-pushed the foundry/c1351db8-b98b-4369-907a-0b6fee584dc8 branch from 725f8cd to 8a25b27 Compare September 24, 2026 18:07
@ScottMansfield

Copy link
Copy Markdown
Member Author

Foundry merge critic: APPROVE

Adds a TypeScript port of the Python ADK planners (BasePlanner, BuiltInPlanner, PlanReActPlanner), exports them from the common entry point, and adds unit tests for them.

Rubric — the default is approve; each rule is a reason a human should read this change first.

[no ] public_api — adds three new named exports in core/src/common.ts, and no existing export or signature changes
[no ] weakened_guarantee — no check is relaxed, no suppression or any type is added, and all code is new
[no ] sensitive_surface — the planners only build prompt text and filter response parts, with no auth, paths, parsing of outside input or process spawning
[no ] release_surface — no workflow, release config or package.json field changes
[no ] test_removed — adds two new test files under core/test/planners, and no existing test changes
[no ] inexplicable — every hunk is part of the planners port, and there are no unrelated edits

Posted by Foundry's merge critic as evidence rather than a request, so nothing here is waiting on you. Advisory only: Foundry has given no approval.

@ScottMansfield
ScottMansfield merged commit 05d62ed into main Sep 24, 2026
14 checks passed
@ScottMansfield
ScottMansfield deleted the foundry/c1351db8-b98b-4369-907a-0b6fee584dc8 branch September 24, 2026 18:24
@kalenkevich kalenkevich mentioned this pull request Sep 23, 2026

@AmaadMartin AmaadMartin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve. This is a faithful port of the adk-python v0.1.0 planners. I verified three things: the classes export through common.ts and index.ts, the helpers are module-level functions, and the diff adds no type suppressions or instanceof checks. My one open comment on line 69 is an optional nit -- the > 0 guard matches v0.1.0, and main later changed it to >= 0. CI was green and the PR is already merged.

prasanna8585 pushed a commit to prasanna8585/adk-js that referenced this pull request Nov 10, 2026
…google#941)

## Task
Port the planners package of adk-python v0.1.0 (src/google/adk/planners: base_planner.py, built_in_planner.py, plan_re_act_planner.py) into adk-js as core/src/planners. This is a new capability. No planner code exists in adk-js today. Wiring a planner into LlmAgent and a planning request/response processor is NOT part of this task (see open_questions).

Produced by Foundry (task c1351db8-b98b-4369-907a-0b6fee584dc8). Reviewed by an automated
reviewer before upload; still needs human review.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants